INCLUDE =	-I/usr/local/include -I/usr/devel/include

CFLAGS = 	-O2 -Wall $(INCLUDE) -DYYDEBUG
LIBS =		-L/usr/devel/lib

LFLAGS =
CC = 		gcc
DEPENDS =	.depend
INSTALL =	/usr/bin/install --strip
INSTALLDIR =	/usr/local/bin

PROGS =		asoft_detoken catalog zd

all:		$(DEPENDS) $(PROGS)

clean:
		rm -f *~ *.o $(PROGS) .depend

install: 	all
		$(INSTALL) $(PROGS) $(INSTALLDIR)

.depend:	*.c 
		$(CC) -M $(CFLAGS) *.c > $(DEPENDS)


asoft_detoken:	asoft_detoken.o
		$(CC) $(LFLAGS) -o asoft_detoken asoft_detoken.o
	
catalog:	catalog.o
		$(CC) $(LFLAGS) -o catalog catalog.o

ASOFT =		asoft.o amain.o
asoft:		$(ASOFT)
		$(CC) -o asoft $(ASOFT) $(LIBS)

asoft.o:	asoft.tab.c

asoft.tab.c:	asoft.y
		yacc -b asoft -d asoft.y


include		$(DEPENDS)
